package com.yqzl.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yqzl.entity.User;
import com.yqzl.mapper.User_basicMapper;
import com.yqzl.service.User_basicService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class User_basicImpl extends ServiceImpl<User_basicMapper, User> implements User_basicService {
  @Resource
  User_basicMapper user_basicMapper;

  @Override
  public User getUserByUnameAndPwd(User user) {
    QueryWrapper<User> queryWrapper = new QueryWrapper<>();
//     eq 是等于符号， 左边的是数据库的列，右边的是具体的值
    queryWrapper.eq("uname", user.getUname());
    queryWrapper.eq("pwd", user.getPwd());
    User user1 = user_basicMapper.selectOne(queryWrapper);
    return user1;
  }
}
